﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using SilverlightInEnterprise.DataAccess;
using SilverlightInEnterprise.ServiceContract;

namespace SilverlightInEnterprise.Web
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "StaticDataService" in code, svc and config file together.
    public class StaticDataService : IStaticDataService
    {
     

        public IEnumerable<CaseWorkflowType> GetCaseWorkflowTypes()
        {
            IEnumerable<CaseWorkflowType> types = null;
            using (SilverlightInEnterpriseContext db = new SilverlightInEnterpriseContext())
            {
                types = db.CaseWorkflowTypes.ToArray();
            }
            return types;
        }


        public IEnumerable<State> GetStates()
        {
            IEnumerable<State> items= null;
            using (SilverlightInEnterpriseContext db = new SilverlightInEnterpriseContext())
            {
                items = db.States.ToArray();
            }
            return items;
        }

        public IEnumerable<Product> GetProducts()
        {
            IEnumerable<Product> items = null;
            using (SilverlightInEnterpriseContext db = new SilverlightInEnterpriseContext())
            {
                items = db.Products.ToArray();
            }
            return items;
        }

        public IEnumerable<ProductCategory> GetProductCategories()
        {
            throw new NotImplementedException();
        }

        public IEnumerable<AddressType> GetAddressTypes()
        {
            throw new NotImplementedException();
        }

        public IEnumerable<string> GetEntitlementKeys()
        {
            throw new NotImplementedException();
        }
    }
}
